#pragma once
#include <Winhttp.h>
#include "Bin.h"
#include "String.h"

class Http2{
public:
	Http2	(PTSTR);
	~Http2	(void);

	Bin*	get		(PTSTR);
	Bin*	put		(PTSTR,void*,uint);
	uint	status	(void);

protected:
	PTSTR	name;
	int		port;
	virtual void	onCallback	(HINTERNET,uint,LPVOID,uint);

private:
	static void CALLBACK	callback(HINTERNET,DWORD_PTR,DWORD,LPVOID,DWORD);

	HINTERNET	connect;
	HINTERNET	req;
	HINTERNET	session;

	Bin*	exec	(PTSTR,PTSTR,int,PTSTR,void*,uint);
};